bump rain-math-float 0.2.1 -> 0.2.4 - #29
Conversation
`LibDecimalFloat.agree` landed in 0.2.2 and gained its tolerance guard in 0.2.4. rainlang needs 0.2.4 for the `agree` word, and cannot take it while this package pins 0.2.1: soldeer keys `[dependencies]` by package name, so a consumer cannot hold two versions of `rain-math-float` at once, and `LibDecimalFloatDeploy` imports `LOG_TABLE_DISAMBIGUATOR` and `LogTablesNotDeployed` from the pinned one. That is what fails rainlang's CI at compile today. THE `DecimalFloat` CANDIDATE PIN MOVES. The concrete embeds `LibDecimalFloat`, which changed between 0.2.1 and 0.2.4 — `agree` and its guard, and the comparison set moving to the unpacked implementation — so its creation code and therefore its Zoltu address change: bytecode hash 0xdc468883... -> 0x12b70b2f... address 0x799632d2... -> 0x16cf47be... The new address needs deploying, and anything pinning the old one keeps talking to the 0.2.1 contract. `LogTables` DOES NOT MOVE — hash `0x2573004a...` and address `0xc51a1425...` are unchanged, because the tables do not depend on `LibDecimalFloat`. No table redeploy, and no consumer of the tables is affected. Measured by regenerating both candidates and diffing, not assumed. `src/generated/candidate/DecimalFloat.sol` regenerated via `script/Build.sol`, and `crates/float/abi/DecimalFloat.json` via `script/CopyArtifacts.sol` — the test that guards the committed artifact named that script and it is the sanctioned path. 41 suites, 72 passing. The 6 failures are the `*_RPC_URL` fork tests with no env vars locally; CI holds those secrets. Lint and fmt clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (41)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe ChangesDependency upgrade
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to No concrete regression or artifact mismatch was established; the upgrade is suitable to merge with normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 4 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Without this the bump moved the concrete's Zoltu address while its external surface stayed byte-identical: the ABI diff was two `object` lines, bytecode only. The address change bought consumers of the concrete nothing, and adding `agree` after the release would have moved it a second time. `agree` is now exposed alongside the comparisons it belongs with, so the Rust bindings can call it — which is what this concrete is for. The tolerance guard reaches an offchain caller as a revert rather than a silent answer, so `AgreeToleranceNegative` and `AgreeNoPositiveTolerance` are now part of this contract's observable behaviour. Address moves once, to the value that includes `agree`: bytecode hash 0xdc468883... -> 0x0d43af49... address 0x799632d2... -> 0xEc632ea4... `LogTables` is still untouched at `0xc51a1425...`. Three tests, following the file-per-function pattern the other concrete tests use: - `testAgreeDeployed` fuzzes all four operands as arbitrary packed words and asserts the deployed contract answers what the library answers, or reverts with the same data. Arbitrary words means the guard's rejections are exercised alongside the ordinary answers. - `testAgreeDeployedRejectsBadTolerances` pins both errors with their tolerances. The fuzz above would pass if both sides returned the same wrong thing; this will not. - `testAgreeDeployedBoundary` pins a concrete answer either side of the limit, so the exposed function is tied to the formula rather than to whatever the library happens to return. 42 suites, 75 passing. The 6 failures are the `*_RPC_URL` fork tests with no env vars locally. Lint and fmt clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
LibDecimalFloat.agreelanded in 0.2.2 and gained its tolerance guard in 0.2.4.rainlang needs 0.2.4 for the
agreeword and cannot take it while this packagepins 0.2.1: soldeer keys
[dependencies]by package name, so a consumer cannothold two versions of
rain-math-floatat once, andLibDecimalFloatDeployimports
LOG_TABLE_DISAMBIGUATORandLogTablesNotDeployedfrom the pinnedone. That is what fails rainlanguage/rainlang#592 at compile today.
The
DecimalFloatcandidate pin moves, andagreeis exposedagreeis now on the concrete, so the Rust bindings can call it. Without thatthis bump moved the address while the external surface stayed byte-identical —
the ABI diff was two
objectlines, bytecode only — and addingagreelaterwould have moved it a second time.
The concrete embeds
LibDecimalFloat, which changed between 0.2.1 and 0.2.4 —agreeand its guard, and the comparison set moving down to the unpackedimplementation — so its creation code and therefore its Zoltu address change:
0xdc468883…0x0d43af49…0x799632d2…0xEc632ea4…The new address needs deploying, and anything pinning the old one keeps
talking to the 0.2.1 contract. That is the operational cost of this bump and the
reason it is its own PR rather than folded into a consumer's.
LogTablesdoes not moveHash
0x2573004a…and address0xc51a1425…are unchanged, because the tablesdo not depend on
LibDecimalFloat. No table redeploy, and no consumer of thetables is affected.
Measured by regenerating both candidates and diffing the before/after, not
inferred from which files the bump touched.
Regeneration
src/generated/candidate/DecimalFloat.solviascript/Build.sol.crates/float/abi/DecimalFloat.jsonviascript/CopyArtifacts.sol— the testguarding the committed artifact names that script, so it is the sanctioned
path rather than a hand edit.
QA
tests, and both fired on base before regeneration: the committed-artifact check
failed naming
CopyArtifacts.sol, and the candidate pin differed from a freshBuild.solrun. Both pass now. They discriminate in the direction that matters— a bump that changed the concrete's bytecode without updating the pins leaves
the repo claiming an address that no longer corresponds to what it compiles,
which is exactly what these guards exist to catch.
rewrites, and two regenerated artifacts. There is no hand-written logic to
mutate; a mutant of a generated pin is just a wrong pin, which the guards above
already fail on.
script/Build.sol, which derives eachaddress by running the creation code through it. The before/after values come
from two runs of that script rather than from reading the diff, and the
LogTableshalf is the control — it is regenerated by the same script in thesame run and does not move, which is what shows the
DecimalFloatchange iscaused by
LibDecimalFloatand not by the regeneration itself.blocks its consumer". Covered: the pin, every import path, and both generated
artifacts. Not covered deliberately: deploying the new
DecimalFloataddress,which is an on-chain action outside a PR.
Verification
42 suites, 75 passing, including three new
agreetests: a 2048-run fuzzasserting the deployed contract matches the library or reverts identically, both
guard rejections pinned with their tolerances, and a boundary case either side of
the limit. The 6 failures are the
*_RPC_URLfork tests(
testProdDeployment*,testSuitesLiveOnEverySupportedNetwork) with no env varslocally; CI holds those secrets.
forge lint -D warningsandforge fmt --checkboth exit 0.
Downstream
Unblocks rainlanguage/rainlang#592, which bumps to 0.2.4 and drops the word's own
tolerance validation now that
LibDecimalFloat.agreeguards it.🤖 Generated with Claude Code